package com.sata.sim.ho;

import org.apache.commons.math3.distribution.ExponentialDistribution;
import org.apache.commons.math3.distribution.UniformIntegerDistribution;

import com.sata.sim.data.Constant;
import com.sata.sim.model.Traffic;
import com.sata.sim.model.Traffic.ChannelState;
import com.sata.sim.model.Traffic.TrafficType;

public class TrafficGenerator {
	
	public static Traffic generateTraffic(TrafficType type) {
		
		ExponentialDistribution distr = new ExponentialDistribution(2.0);
		long sample = new Double( distr.sample()).longValue();
		
		
		UniformIntegerDistribution udistr = new UniformIntegerDistribution(0,Constant.R);
		int rposition = udistr.sample();
		Cell cell = null ; 
		
		
		Traffic traffic = new Traffic();
		traffic.setType(type);
		traffic.setTime(sample);
		traffic.setOrigincell(cell);
		traffic.setChannelState(ChannelState.S1LOS);
		
		
		
		
		return traffic;
		
	}

}
